import { httpPost, httpGet, httpDel } from '../index'
import config from '../config'

export function page (query) {
  return httpGet('/api/admin/file/page', query)
}

export function addObj (obj) {
  return httpPost('/api/admin/file', obj)
}

export function getObj (id) {
  return httpGet('/api/admin/file/' + id)
}

export function delObj (id) {
  return httpDel('/api/admin/file/' + id)
}

export function fileUploadPath () {
  return config.baseURL + '/api/admin/file'
}

export function downloadUrl (name) {
  return config.baseURL + '/api/admin/file/download?name=' + name + '&delete=true'
}
